<ui:composition xmlns="http://www.w3.org/1999/xhtml"
			  xmlns:h="http://java.sun.com/jsf/html"
			  xmlns:f="http://java.sun.com/jsf/core"
			  xmlns:ui="http://java.sun.com/jsf/facelets"
			  xmlns:c="http://java.sun.com/jstl/core"
			  xmlns:fn="http://java.sun.com/jsp/jstl/functions">
    <h:form>
        <div style="text-align:right;">
            <div style="float:left;">
                <!-- <h:commandButton immediate="true" action="#{deathCrud.createSetup}" value="#{msg.lblAddNew}" id="button1" /> -->
                
                <!-- Paging -->	
				<ui:include src="/snippets/paging.xhtml">
				     <ui:param name="currentCrud" value="#{deathCrud}"/>
				</ui:include>		
            </div>
        </div>

        <!-- Search Widget -->
            <ui:include src="/search/searchBox.xhtml">
                <ui:param name="crud" value="#{deathCrud}"/>
            </ui:include>

		<c:if test="#{flowScope == null}">
        	<div>
            	<h:outputText escape="false" value="#{msg.deathEmpty}" rendered="#{deathCrud.pager.totalCount == 0}" />
                <h:panelGroup rendered="#{fn:length(deathCrud.pagedItems) > 0}">
                	<h:dataTable value="#{deathCrud.pagedItems}" var="item"
                                  width="100%" columnClasses="center,center,center,center,center,center,center,width3">
                    	<h:column headerClass="width1">
                        	<f:facet name="header">
                            	<h:outputText value="#{msg.individualId}" />
                            </f:facet>
                            <h:outputText value="#{item.individual}" converter="#{individualExtIdConverter}"/>
                        </h:column>           
                        <h:column headerClass="width1">
                            <f:facet name="header">
                            	<h:outputText value="#{msg.deathPlace}" />
                            </f:facet>
                            <h:outputText value="#{item.deathPlace}" />
                        </h:column>
                        <h:column headerClass="width1">
                            <f:facet name="header">
                                <h:outputText value="#{msg.deathCause}" />
                            </f:facet>
                            <h:outputText value="#{item.deathCause}" />
                        </h:column>
                        <h:column headerClass="width1">
                            <f:facet name="header">
                                <h:outputText value="#{msg.deathDate}" />
                             </f:facet>
                            <h:outputText value="#{item.deathDate}" converter="#{calendarConverter}"/>
                        </h:column>
                        <h:column headerClass="width3">
                            <f:facet name="header">
                                <h:outputText escape="false" value=""/>
                            </f:facet>
							<h:outputLink value="#{request.contextPath}/amendment/death/details/#{item.uuid}">
                            	<h:graphicImage style="border: 0;" title="details" value="/resources/icons/details.ico" />
                           	</h:outputLink>
                            <h:commandLink action="#{deathCrud.editSetup}">
                            	<h:graphicImage title="edit" style="border: 0;" value="/resources/icons/edit.ico"/>
                                <f:param name="itemId" value="#{item.uuid}"/>
                            </h:commandLink>
		                    <h:commandLink  action="#{deathCrud.delete}">
		                     	<h:graphicImage title="delete" style="border: 0;" value="/resources/icons/delete.ico"/>
		                      	<f:param name="itemId" value="#{item.uuid}"/>
		                    </h:commandLink>
                        </h:column>
                    </h:dataTable>
                </h:panelGroup>
            </div>
        </c:if>
        <c:if test="#{flowScope != null}">
        	<div>
            	<h:outputText escape="false" value="#{msg.deathEmpty}" rendered="#{fn:length(deathCrud.filteredPagedItems) == 0}" />

                <h:panelGroup rendered="#{fn:length(deathCrud.filteredPagedItems) > 0}">
                	<h:dataTable value="#{deathCrud.filteredPagedItems}" var="item"
                                  width="100%" columnClasses="center,center,center,center,center,center,center,width3">
                    	<h:column headerClass="width1">
                        	<f:facet name="header">
                            	<h:outputText value="#{msg.individualNo}" />
                            </f:facet>
                            <h:outputText value="#{item.individual}" title="#{msg.tipIndivExtId}" converter="#{individualExtIdConverter}"/>
                        </h:column>           
                        <h:column headerClass="width1">
                            <f:facet name="header">
                                <h:outputText value="#{msg.deathPlace}" />
                            </f:facet>
                            <h:outputText value="#{item.deathPlace}" />
                        </h:column>
                        <h:column headerClass="width1">
                            <f:facet name="header">
                                <h:outputText value="#{msg.deathCause}" />
                            </f:facet>
                            <h:outputText value="#{item.deathCause}" />
                        </h:column>
                        <h:column headerClass="width1">
                            <f:facet name="header">
                                <h:outputText value="#{msg.deathDate}" />
                            </f:facet>
                            <h:outputText value="#{item.deathDate}" converter="#{calendarConverter}"/>
                        </h:column>
                        <h:column headerClass="width3">
                            <f:facet name="header">
                                <h:outputText escape="false" value=""/>
                            </f:facet>
                            <h:commandLink action="#{deathCrud.detailSetup}">
                                <h:graphicImage title="view" style="border: 0;" value="/resources/icons/details.ico"/>
                                <f:param name="itemId" value="#{item.uuid}"/>
                            </h:commandLink>
                            <h:outputText value=" "/>
                            <h:commandLink  action="#{deathCrud.editSetup}">
                                <h:graphicImage title="edit" style="border: 0;" value="/resources/icons/edit.ico"/>
                                <f:param name="itemId" value="#{item.uuid}"/>
                            </h:commandLink>
                            <h:outputText value=" "/>
                       		<h:commandLink  action="#{deathCrud.delete}">
                            	<h:graphicImage title="delete" style="border: 0;" value="/resources/icons/delete.ico"/>
                           		<f:param name="itemId" value="#{item.uuid}"/>
                        	</h:commandLink>
                    	</h:column>
                	</h:dataTable>
            	</h:panelGroup>
        	</div>	                
    	</c:if>
	</h:form>
</ui:composition>